/***************************************************************************
 创建者：华磊
 开始时间：         : 2020.12.13
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 ***************************************************************************
 *   等待指令属性编辑视窗
*                                                                         *
 ***************************************************************************/
#include "waitcommanddelegate.h"
#include <QDebug>

WaitCommandDelegate::WaitCommandDelegate(QWidget *parent):
    QObject(parent)
{
}
void WaitCommandDelegate::initView()
{
    waitCommandView->initData();
}
void WaitCommandDelegate::clearNoteSlot()
{
    waitCommandView->note.clear();

    qDebug("clear note");
}
void WaitCommandDelegate::finishEditInstructionSlot()
{
    //组装指令

    waitCommandView->waitCommandInstruction = "WAIT_COMMAND ";
    waitCommandView->waitCommandInstruction += QString("R[%1],").arg(waitCommandView->registerIndex);
    waitCommandView->waitCommandInstruction += QString("TIMEOUT %1,").arg(waitCommandView->waitMaxTime);
    waitCommandView->waitCommandInstruction += QString("JMP LBL[%1] //").arg(waitCommandView->timeOutLabel.toInt());
    waitCommandView->waitCommandInstruction += waitCommandView->note;

    qDebug()<<waitCommandView->waitCommandInstruction;
}
